﻿using System.Web.Mvc;
using NOSDC.Models;
using NOSDC.Repositories.Documents;

namespace NOSDC.Controllers
{
    public class DownloadsController : Controller
    {
        private readonly IDocumentRepository _repo;

        public DownloadsController()
        {
            _repo = new DocumentRepository();
        }

        [Authorize(Roles = "Member")]
        public ActionResult Index()
        {
            var docs = _repo.GetDocuments();
            return View(new DocumentsListViewModel(docs));
        }
    }
}
